
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_Hans">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>使 Django 本地化 &#8212; Django 3.2.6.dev 文档</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="提交代码" href="committing-code.html" />
    <link rel="prev" title="编写文档" href="writing-documentation.html" />



 
<script src="../../templatebuiltins.js"></script>
<script>
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../index.html">Django 3.2.6.dev 文档</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../index.html">Home</a>  |
        <a title="Table of contents" href="../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../genindex.html">Index</a>  |
        <a title="Module index" href="../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="writing-documentation.html" title="编写文档">previous</a>
     |
    <a href="../index.html" title="Django internals" accesskey="U">up</a>
   |
    <a href="committing-code.html" title="提交代码">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="internals-contributing-localizing">
            
  <div class="section" id="s-localizing-django">
<span id="localizing-django"></span><h1>使 Django 本地化<a class="headerlink" href="#localizing-django" title="永久链接至标题">¶</a></h1>
<p>Django 的很多部分，比如后台站点和认证错误提示都是国际化的。这意味着它们根据使用者的语言展示不同的信息。为此，Django 使用了和 Django 应用相同的国际化和本地化基础设施，在 <a class="reference internal" href="../../topics/i18n/index.html"><span class="doc">i18n documentation</span></a> 中介绍。</p>
<div class="section" id="s-translations">
<span id="translations"></span><h2>翻译<a class="headerlink" href="#translations" title="永久链接至标题">¶</a></h2>
<p>翻译内容由全球的 Django 用户提供。协调工作由 <a class="reference external" href="https://www.transifex.com/">Transifex</a> 负责。</p>
<p>如果你发现了一个错误翻译，或是想探讨某部分的翻译，前往 <a class="reference external" href="https://www.transifex.com/django/django/">Django project page</a>。如果你想帮助翻译，或是添加一个未被收录的语言，以下是如何做的方式：</p>
<ul>
<li><p class="first">加入 <a class="reference internal" href="../mailing-lists.html#django-i18n-mailing-list"><span class="std std-ref">Django i18n mailing list</span></a> 并介绍你自己。</p>
</li>
<li><p class="first">确保你已经阅读了 <a class="reference internal" href="../../topics/i18n/translation.html#specialties-of-django-i18n"><span class="std std-ref">Specialties of Django translation</span></a> 的注意点。</p>
</li>
<li><p class="first">在 <a class="reference external" href="https://www.transifex.com/">Transifex</a> 注册并访问 <a class="reference external" href="https://www.transifex.com/django/django/">Django project page</a>。</p>
</li>
<li><p class="first">在 <a class="reference external" href="https://www.transifex.com/django/django/">Django project page</a>，选择你期望翻译的语言， <strong>或</strong> ——如果该语言不存在——点击“Request language”链接，选择合适的语言，请求创建一个新的语言团队。</p>
</li>
<li><p class="first">接着，点击“加入团队”按钮成为团队的一员。每个团队至少拥有一位协调员，负责管理团队的请求。你可以联系团队协调员，了解程序性问题或翻译进度。</p>
</li>
<li><p class="first">一旦你成为团队的一员，你就可以在团队页选择你要翻译的文档。例如，“核心”资源是指包含所有非 contrib 翻译的翻译目录。 每个 contrib 应用程序也有一个资源（前缀为“contrib”）。</p>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">更多关于如何使用 Transifex 的信息，阅读 <a class="reference external" href="https://docs.transifex.com/">Transifex User Guide</a>。</p>
</div>
</li>
</ul>
<p>来自 Transifex 的翻译只会在发布新 term:<a href="#id1"><span class="problematic" id="id2">`</span></a>feature release ` 时集成进 Django 仓库。我们尝试在以下某个 :term:<a href="#id3"><span class="problematic" id="id4">`</span></a>patch release ` 中再次更新它们，但这取决于翻译管理器的可用性。 因此，请不要错过字符串冻结期（发布候选版和功能发布版之间），借此机会完成并修复您的语言翻译！</p>
</div>
<div class="section" id="s-formats">
<span id="formats"></span><h2>格式<a class="headerlink" href="#formats" title="永久链接至标题">¶</a></h2>
<p>你页可以阅读 <code class="docutils literal notranslate"><span class="pre">conf/locale/&lt;locale&gt;/formats.py</span></code>。该文件介绍了基于你所在地的日期，时间和数字的格式。参考 <a class="reference internal" href="../../topics/i18n/formatting.html"><span class="doc">Format localization</span></a> 获得更多信息。</p>
<p>格式文件并不由 Transifex 管理。要修改它们的话，你必须对比当前 Django 代码 <a class="reference internal" href="writing-code/submitting-patches.html"><span class="doc">创建一个补丁</span></a> ，就像修改其它代码一样：</p>
<ul class="simple">
<li>Create a diff against the current Git main branch.</li>
<li>在 Django 的工单系统创建一个工单，设置其 <code class="docutils literal notranslate"><span class="pre">Component</span></code> 字段为 <code class="docutils literal notranslate"><span class="pre">Translations</span></code>，并附上补丁。</li>
</ul>
</div>
<div class="section" id="s-documentation">
<span id="s-translating-documentation"></span><span id="documentation"></span><span id="translating-documentation"></span><h2>文档<a class="headerlink" href="#documentation" title="永久链接至标题">¶</a></h2>
<p>还有翻译文档的机会，虽然这是一项浩大的工程（事先提醒！）。同样，我们使用 <a class="reference external" href="https://www.transifex.com/django/django-docs/">Transifex tool</a>。只要 <code class="docutils literal notranslate"><span class="pre">docs/intro/*</span></code> 部分的全部文档被翻译，你就能在 <code class="docutils literal notranslate"><span class="pre">https://docs.djangoproject.com/&lt;language_code&gt;/</span></code> 见到该语言的版本。中文翻译团队官网：<a class="reference external" href="https://www.djangodocs.com/">https://www.djangodocs.com/</a>。</p>
<p>一旦翻译发布，Transifex 的更新版本将不定期地移植到 <a class="reference external" href="https://github.com/django/django-docs-translations">django/django-docs-translations</a> 存储库和文档网页。只更新最新稳定的 Django 版本的翻译。</p>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">使 Django 本地化</a><ul>
<li><a class="reference internal" href="#translations">翻译</a></li>
<li><a class="reference internal" href="#formats">格式</a></li>
<li><a class="reference internal" href="#documentation">文档</a></li>
</ul>
</li>
</ul>

  <h4>上一个主题</h4>
  <p class="topless"><a href="writing-documentation.html"
                        title="上一章">编写文档</a></p>
  <h4>下一个主题</h4>
  <p class="topless"><a href="committing-code.html"
                        title="下一章">提交代码</a></p>
  <div role="note" aria-label="source link">
    <h3>本页</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/internals/contributing/localizing.txt"
            rel="nofollow">显示源代码</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>快速搜索</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="转向" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">7月 23, 2021</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="writing-documentation.html" title="编写文档">previous</a>
     |
    <a href="../index.html" title="Django internals" accesskey="U">up</a>
   |
    <a href="committing-code.html" title="提交代码">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>